group { name: "elm/frame/base/default";
   images.image: "win_shad_flat.png" COMP;
   parts {
      part { name: "shadow"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "_sh1";
            color_class: "/shadow/normal/frame";
         }
      }
      WIN_SHAD("base", "shadow", "win_shad_flat.png", 10, 10, 7, 14, 0.25);
      part { name: "base"; type: SPACER;
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 6 6;
            rel2.offset: -7 -7;
            offscale;
         }
      }
      part { name: "top_bg"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "top";
            color_class: "/bg/normal/frame/title";
         }
      }
      part { name: "top"; type: SPACER;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to: "base";
            rel2.to_x: "base";
            rel2.to_y: "elm.text";
            rel2.offset: -1 3;
            offscale;
         }
      }
      part { name: "elm.text"; type: TEXT;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "base";
            rel1.offset: 4 4;
            rel2.relative: 1.0 0.0;
            rel2.offset: -5 4;
            align: 0.0 0.0;
            color_class: "/fg/normal/frame/title";
            text { font: FNBD; size: 10;
               align: 0.0 0.5;
               min: 0 1;
            }
            fixed: 0 1;
            offscale;
         }
      }
      part { name: "bg"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to_x: "base";
            rel1.to_y: "top";
            rel1.relative: 0.0 1.0;
            rel2.to: "base";
            color_class: "/bg/normal/frame";
         }
      }
      part { name: "clip"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "bg";
         }
      }
      part { name: "elm.swallow.content"; type: SWALLOW;
         clip_to: "clip";
         scale: 1;
         description { state: "default" 0.0;
            align: 0.0 1.0;
            rel.to: "bg";
            rel1.offset: 4 4;
            rel2.offset: -5 -5;
            offscale;
         }
         description { state: "collapsed" 0.0;
            inherit: "default" 0.0;
            minmul: 1.0 0.0;
            rel1.offset: 4 0;
            rel2.offset: -5 -1;
         }
      }
      part { name: "event"; type: RECT; ignore_flags: ON_HOLD;
         description { state: "default" 0.0;
            color: 0 0 0 0; // no cc
            rel1.to_y: "elm.text";
            rel2.to_y: "elm.text";
         }
      }
   }
   programs {
      program { name: "collapse";
         action:  STATE_SET "collapsed" 0.0;
         target: "elm.swallow.content";
         transition: ACCELERATE 0.3;
         after: "signal";
      }
      program { name: "expand";
         action:  STATE_SET "default" 0.0;
         target: "elm.swallow.content";
         transition: DECELERATE 0.3;
         after: "signal";
      }
      program { signal:  "mouse,up,1"; source:  "event";
         action:  SIGNAL_EMIT "elm,action,click" "elm";
      }
      program { signal:  "elm,action,toggle"; source: "elm";
         script {
            new st[31];
            new Float:vl;
            get_state(PART:"elm.swallow.content", st, 30, vl);
            if (!strcmp(st, "default"))
              run_program(PROGRAM:"collapse");
            else
              run_program(PROGRAM:"expand");
         }
      }
      program { signal:  "elm,action,switch"; source: "elm";
         script {
            new st[31];
            new Float:vl;
            get_state(PART:"elm.swallow.content", st, 30, vl);
            if (!strcmp(st, "default"))
              set_state(PART:"elm.swallow.content", "collapsed", 0.0);
            else
              set_state(PART:"elm.swallow.content", "default", 0.0);
         }
      }
      program { name: "signal";
         action: SIGNAL_EMIT "elm,anim,done" "elm";
      }
   }
}

group { name: "elm/frame/base/icon";
   inherit: "elm/frame/base/default";
   parts {
      part { name: "elm.swallow.icon"; type: SWALLOW;
         insert_after: "top_bg";
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "base";
            rel1.to_y: "elm.text";
            rel2.to_y: "elm.text";
            rel1.offset: 4 0;
            rel2.relative: 0.0 0.0;
            rel2.offset: 4 -1;
            align: 0.0 0.5;
            min: 15 15;
            offscale;
         }
      }
      part { name: "elm.text";
         description { state: "default" 0.0;
            rel1.to_x: "elm.swallow.icon";
            rel1.relative: 1.0 0.0;
            min: 0 15;
         }
      }
   }
}

group { name: "elm/frame/base/border";
   inherit: "elm/frame/base/icon";
   parts {
      part { name: "top_bg";
         description { state: "default" 0.0;
            color_class: "/bg/selected/titlebar";
         }
      }
      part { name: "elm.text";
         description { state: "default" 0.0;
            rel2.to_x: "close";
            rel2.relative: 0.0 0.0;
            min: 0 15;
            color_class: "/fg/selected/titlebar";
         }
      }
      part { name: "close";
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "base";
            rel1.to_y: "elm.text";
            rel2.to_y: "elm.text";
            rel1.offset: -5 0;
            rel1.relative: 1.0 0.0;
            rel2.offset: -5 -1;
            align: 1.0 0.5;
            min: 15 15;
            max: 15 15;
            offscale;
            image.normal: "i-close";
            color_class: "/fg/selected/titlebar/buttons/close";
         }
         description { state: "clicked" 0.0;
            inherit: "default" 0.0;
            color_class: "/fg/pressed/titlebar/buttons/close";
         }
      }
      program { signal:  "mouse,down,1"; source:  "close";
         action:  STATE_SET "clicked" 0.0;
         target: "close";
      }
      program { signal:  "mouse,up,1"; source:  "close";
         action:  STATE_SET "default" 0.0;
         target: "close";
      }
      program { signal:  "mouse,clicked,1"; source:  "close";
         action: SIGNAL_EMIT "elm,action,close" "elm";
      }
   }
}

group { name: "elm/frame/base/overlay";
   inherit: "elm/frame/base/default";
   parts {
      part { name: "bg";
         description { state: "default" 0.0;
            color_class: "/dim/normal/frame-overlay";
         }
      }
   }
}

group { name: "elm/frame/base/icon_overlay";
   inherit: "elm/frame/base/icon";
   parts {
      part { name: "bg";
         description { state: "default" 0.0;
            color_class: "/dim/normal/frame-overlay";
         }
      }
   }
}

group { name: "elm/frame/base/border_overlay";
   inherit: "elm/frame/base/border";
   parts {
      part { name: "bg";
         description { state: "default" 0.0;
            color_class: "/dim/normal/frame-overlay";
         }
      }
   }
}

group { name: "elm/frame/base/pad_small";
   parts {
      part { name: "b0"; type: SPACER;
         scale: 1;
         description { state: "default" 0.0;
            min: 3 3; max: 3 3;
            align: 0.0 0.0;
         }
      }
      part { name: "b1"; type: SPACER;
         scale: 1;
         description { state: "default" 0.0;
            min: 3 3; max: 3 3;
            align: 1.0 1.0;
         }
      }
      part { name: "elm.swallow.content"; type: SWALLOW;
         description { state: "default" 0.0;
            rel1.to: "b0";
            rel1.relative: 1.0 1.0;
            rel2.to: "b1";
            rel2.relative: 0.0 0.0;
         }
      }
   }
}

group { name: "elm/frame/base/pad_medium";
   inherit: "elm/frame/base/pad_small";
   parts {
      part { name: "b0";
         scale: 1;
         description { state: "default" 0.0;
            min: 6 6; max: 6 6;
         }
      }
      part { name: "b1";
         scale: 1;
         description { state: "default" 0.0;
            min: 6 6; max: 6 6;
         }
      }
   }
}

group { name: "elm/frame/base/pad_large";
   inherit: "elm/frame/base/pad_small";
   parts {
      part { name: "b0";
         scale: 1;
         description { state: "default" 0.0;
            min: 12 12; max: 12 12;
         }
      }
      part { name: "b1";
         scale: 1;
         description { state: "default" 0.0;
            min: 12 12; max: 12 12;
         }
      }
   }
}

group { name: "elm/frame/base/pad_huge";
   inherit: "elm/frame/base/pad_small";
   parts {
      part { name: "b0";
         scale: 1;
         description { state: "default" 0.0;
            min: 24 24; max: 24 24;
         }
      }
      part { name: "b1";
         scale: 1;
         description { state: "default" 0.0;
            min: 24 24; max: 24 24;
         }
      }
   }
}

group { name: "elm/frame/base/outdent_top";
   parts {
      part { name: "elm.swallow.content"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            rel1.to_y: "base";
            rel1.relative: 0.0 1.0;
            rel1.offset: 4 4;
            rel2.offset: -5 -5;
            offscale;
         }
      }
      part { name: "base"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 0 1;
            rel1.offset: 4 2;
            rel2.offset: -5 2;
            rel2.relative: 1.0 0.0;
            min: 0 1;
            color_class: "/fg/normal/frame/separator";
            offscale;
         }
      }
   }
}

group { name: "elm/frame/base/outdent_bottom";
   parts {
      part { name: "elm.swallow.content"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 4 4;
            rel2.to_y: "base";
            rel2.relative: 1.0 0.0;
            rel2.offset: -5 -5;
            offscale;
         }
      }
      part { name: "base"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            fixed: 0 1;
            rel1.offset: 4 -3;
            rel1.relative: 0.0 1.0;
            rel2.offset: -5 -3;
            min: 0 1;
            color_class: "/fg/normal/frame/separator";
            offscale;
         }
      }
   }
}

group { name: "elm/frame/base/outline";
   parts {
      part { name: "shadow"; type: RECT;
         description { state: "default" 0.0;
            rel.to: "_sh1";
            color_class: "/shadow/normal/frame";
         }
      }
      WIN_SHAD("base", "shadow", "win_shad_flat.png", 10, 10, 7, 14, 0.25);
      part { name: "base"; type: RECT;
         scale: 1;
         description { state: "default" 0.0;
            rel1.offset: 6 6;
            rel2.offset: -7 -7;
            color_class: "/bg/normal/frame";
            offscale;
         }
      }
      part { name: "elm.swallow.content"; type: SWALLOW;
         scale: 1;
         description { state: "default" 0.0;
            rel.to: "base";
            offscale;
         }
      }
   }
}
